package com.mlnx.weicesugartp.enums;

/**
 * Created by amanda.shan on 2019/11/26.
 * 1：时间同步，
 * 2：登录上传设备信息，
 * 3：上传血糖数据
 * 4：服务器切换
 * 5：批量上传血糖数据
 */
public enum Commond {
    SYN_TIME("1", "时间同步"), UP_DEVICE_INFO("2", "登录上传设备信息"),
    UP_SUGAR("3", "上传血糖数据"), CHANGE_SERVER("4", "服务器切换"),
    MUTIL_UP_SUGAR("5", "批量上传血糖数据");

    private String code;

    private String msg;

    Commond(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public static Commond devoce(String code){
        for (Commond commond : Commond.values()){
            if (commond.getCode().equals(code)){
                return commond;
            }
        }

        return null;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
